﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

namespace Sbook.Data
{
    public class UomController:SqlDataProvider
    {
        public List<UomInfo> Uom_GetByAll()
        {
            List<Data.UomInfo> list = new List<Data.UomInfo>();
            using (SqlCommand dbCmd = new SqlCommand("sp_Uom_GetByAll", GetConnection()))
            {
                Data.UomInfo obj = new Data.UomInfo();
                dbCmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader dr = dbCmd.ExecuteReader();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        list.Add(obj.UomIDataReader(dr));
                    }
                    dr.Close();
                    //conn.Close();
                }
            }
            return list;
        }
    }
}